import BasicLayout from '../../layouts/BasicLayout.vue';
import Login from '../../views/login/index.vue';


export default [
  {
    path: '/',
    redirect: '/order/index'
  },
  {
    path: '/login',
    component: Login,
    meta: { title: '登录页面' },
  },
  {
    path: '/user',
    component: BasicLayout,
    meta: { title: '用户管理' },
    children: [
      {
        path: '/user/index',
        name: 'UserManagement',
        component: () => import('../../views/user/index.vue'),
        meta: { title: '用户管理', requireAuth: true },
      },
      {
        path: '/user/address',
        name: 'AddressManagement',
        component: () => import('../../views/user/address.vue'),
        meta: { title: '地址管理', requireAuth: true },
      }
    ]
  },
  {
    path: '/content',
    component: BasicLayout,
    meta: { title: '内容管理' },
    children: [
      {
        path: '/content/banner',
        name: 'BannerManagement',
        component: () => import('../../views/content/banner/index.vue'),
        meta: { title: '轮播图管理', requireAuth: true },
      }
    ]
  },
  {
    path: '/product',
    component: BasicLayout,
    meta: { title: '商品管理' },
    children: [
      {
        path: '/product/goods',
        name: 'GoodsManagement',
        component: () => import('../../views/product/goods/index.vue'),
        meta: { title: '商品列表', requireAuth: true },
      },
      {
        path: '/product/category',
        name: 'CategoryManagement',
        component: () => import('../../views/product/category/index.vue'),
        meta: { title: '商品分类', requireAuth: true },
      },
      {
        path: '/product/brand',
        name: 'BrandManagement',
        component: () => import('../../views/product/brand/index.vue'),
        meta: { title: '商品品牌', requireAuth: true },
      }
    ]
  },
  {
    path: '/order',
    component: BasicLayout,
    meta: { title: '订单管理' },
    children: [
      {
        path: '/order/index',
        name: 'OrderManagement',
        component: () => import('../../views/order/index.vue'),
        meta: { title: '订单管理', requireAuth: true },
      }
    ]
  },
  {
    path: '/error',
    component: BasicLayout,
    meta: { title: '错误页面' },
    children: [
      {
        path: '/error/404',
        component: () => import('../../views/error/404.vue'),
        meta: { title: '404' },
      }
    ]
  },


]
